package com.zhao.dome01.service.impl;

import com.zhao.dome01.mapper.CosPlayerMapper;
import com.zhao.dome01.pojo.dto.CosPlayerEnrollDto;
import com.zhao.dome01.pojo.entry.CosPlayer;
import com.zhao.dome01.service.CosPlayerService;
import org.springframework.stereotype.Service;

@Service
public class CosPlayerServiceImpl implements CosPlayerService {

    private final CosPlayerMapper cosPlayerMapper;

    public CosPlayerServiceImpl(CosPlayerMapper cosPlayerMapper) {
        this.cosPlayerMapper = cosPlayerMapper;
    }

    //接口实现类 用户注册在表中插入注册信息
    @Override
    public void cosPlayerInsert(CosPlayerEnrollDto cosPlayerEnrollDto) {
        cosPlayerMapper.insert(cosPlayerEnrollDto);
    }

    //通过username  在表中查询用户的所有信息
    @Override
    public CosPlayer selectCosPlayerByUsername(String username) {
        CosPlayer cosPlayer = cosPlayerMapper.selectByUsername(username);
        return cosPlayer;
    }
}
